aboutsummaryrefslogtreecommitdiff
path: root/src/pages/[...path].tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/[...path].tsx')
-rw-r--r--src/pages/[...path].tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/[...path].tsx b/src/pages/[...path].tsx
index 5bedae3..19dc42d 100644
--- a/src/pages/[...path].tsx
+++ b/src/pages/[...path].tsx
@@ -7,15 +7,18 @@ import Image from '../Image';
import emojiPlugin from '../emojiPlugin';
import remarkGemoji from 'remark-gemoji';
import benzinConfig from '../benzinConfig';
+import Code from '../Code';
const transformLinkUri = (uri: string): string => {
return uri.match(/(.*)\.md/)?.[1] || uri;
}
+/* Image sources are relative to CDN root */
const transformImageUri = (uri: string): string => {
return uri.startsWith('http') ? uri : benzinConfig.CDN + uri;
}
+/* Disable JavaScript in runtime */
export const config = {
unstable_runtimeJS: false,
};
@@ -27,7 +30,7 @@ export const getStaticProps = async (context: GetStaticPropsContext) => {
);
const markdownSource = await benzinConfig.adapter.getMarkdownSource(benzinConfig.CDN, path);
- const emojiFileNames = await benzinConfig.adapter.getEmojiFileNames(benzinConfig.CDN);
+ const emojiFileNames = await benzinConfig.adapter.getEmojiFileNames(benzinConfig.CDN, benzinConfig.emojiRootPath);
return {
props: {
@@ -63,6 +66,7 @@ const Page: NextPage = ({ markdownSource, emojiFileNames }: any) => {
components={{
emoji: Emoji,
img: Image,
+ code: Code,
h1: 'h2',
h2: 'h3',
h3: 'h4',